Move wfff and google more into new strings. This is probably about as
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 3 Mar 2014 04:01:44 +0000 (04:01 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 3 Mar 2014 04:01:44 +0000 (04:01 +0000)
far as they go until we have Qt 5 and thus http://qt-project.org/doc/qt-5.0/qtcore/json.html
Copyright tweaks so I can quit paying netaddress...

git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4771 f51c46e8-681c-474f-0cfe-069cfd0219fb

24 files changed:
gpsbabel/GPSBabel.xcodeproj/project.xcworkspace/xcuserdata/robertlipe.xcuserdatad/UserInterfaceState.xcuserstate
gpsbabel/alan.cc
gpsbabel/an1.cc
gpsbabel/arcdist.cc
gpsbabel/csv_util.cc
gpsbabel/defs.h
gpsbabel/delbin.cc
gpsbabel/duplicate.cc
gpsbabel/fatal.cc
gpsbabel/filter_vecs.cc
gpsbabel/filterdefs.h
gpsbabel/garmin.cc
gpsbabel/garmin_tables.cc
gpsbabel/google.cc
gpsbabel/googledir.cc
gpsbabel/kml.cc
gpsbabel/nmea.cc
gpsbabel/smplrout.cc
gpsbabel/tef_xml.cc
gpsbabel/teletype.cc
gpsbabel/text.cc
gpsbabel/tiger.cc
gpsbabel/tmpro.cc
gpsbabel/wfff_xml.cc

index 7a088c6a73e0e3291b295d5a28d20cc8c644b435..8abcfeea5ddb78f8035541daaed3b97fddad6eb2 100644 (file)
Binary files a/gpsbabel/GPSBabel.xcodeproj/project.xcworkspace/xcuserdata/robertlipe.xcuserdatad/UserInterfaceState.xcuserstate and b/gpsbabel/GPSBabel.xcodeproj/project.xcworkspace/xcuserdata/robertlipe.xcuserdatad/UserInterfaceState.xcuserstate differ
index 1b83abc15df609240f4cce3e791e42bd2244bb8a..ec42e5ca6b9c35bbffd58e43120fc92bef12113d 100644 (file)
@@ -6,7 +6,7 @@
     Currently supports OS 2.xx only.
 
     Copyright (C) 2007  Gunar Megger, 0xff@quantentunnel.de
-    Copyright (C) 2005  Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index f13fc2b71814cf832d0cb21680ce7b53c6014f1e..2b6b5548290add47a94e984866f847ad52251182 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Read DeLorme drawing files (.an1)
 
-    Copyright (C) 2005 Ron Parker and Robert Lipe.
+    Copyright (C) 2005-2014 Ron Parker and Robert Lipe.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index b8d023b464911c2dcd88ba33f75aa39b6abd88b5..6a59b8250d08eeea24bccb969d0433fc93c47e30 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Distance from point to arc filter
 
-    Copyright (C) 2002 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index 7c6b208d6d67e19faf7852971c6ccc6962c1aae5..28d3c741144944f35adb1e9027becfa4d353ca55 100644 (file)
@@ -2,7 +2,7 @@
     Utilities for parsing Character Separated Value files (CSV)
 
     Copyright (C) 2002 Alex Mottram (geo_alexm at cox-internet.com)
-    Copyright (C) 2002-2007 Robert Lipe
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index a71535a56b6a77a4db84e26f555b7a1dcea03b80..7a3510c880f2d2b5785212943335ba8b4b475eed 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2002-2013 Robert Lipe, robertlipe@gpsbabel.org
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index 243bcf96bfc5c9b5337e6dd7e727615200d09c41..536d64a914cb922d3354b3596070869e04f9530a 100644 (file)
@@ -2,7 +2,7 @@
        DeLorme PN-20/40 USB "DeLBin" protocol
 
     Copyright (C) 2009 Paul Cornett, pc-gpsb at bullseye.com
-    Copyright (C) 2005, 2009  Robert Lipe, robertlipe@gpsbabel.org
+    Copyright (C) 2005-2014 Robert Lipe, robertlipe+source@gpsbabel.orgg
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index 2697f68227dd61e523c89afde53f6cd60e41c101..770d851d7eff9b21f765241dd61abf1cd7b15c2e 100644 (file)
@@ -1,7 +1,7 @@
 /*
     exact duplicate point filter utility.
 
-    Copyright (C) 2002 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index 44840c1124dd2e4a08ef08778753eda58c1ee4ef..8678be2f1615f2ac5fa6040993205c84e5dc660c 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Functions to indicate inconsistent or fatal conditions.
 
-    Copyright (C) 2002-2005 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index 2d2ef72f2e1b1c150bd494c8b02df038858e9c91..fc60503bc9a5ce1837c1d55fb60ec864d323759f 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Describe vectors containing filter operations.
 
-    Copyright (C) 2002,2004,2005,2006,2007 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index c05e07688fd2049ca15de252613bfaab1541f0f1..93ba2e51d7b66a54c1ee0ab5203549891c3ce849 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Filter definitions.
 
-    Copyright (C) 2005  Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2005-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index 704c75c36fb61496fee3fcabd3b7fb91f2df403b..b264e69f986c7749345cd4334216224fcd6dfd70 100644 (file)
@@ -320,7 +320,7 @@ rw_deinit(void)
 }
 
 static int
-waypt_read_cb(int total_ct, GPS_PWay* way)
+waypt_read_cb(int total_ct, GPS_PWay* )
 {
   static int i;
 
@@ -399,7 +399,7 @@ waypt_read(void)
   }
 }
 
-static int lap_read_nop_cb(int n, struct GPS_SWay** dp)
+static int lap_read_nop_cb(int, struct GPS_SWay**)
 {
   return 0;
 }
@@ -835,7 +835,7 @@ sane_GPS_Way_New(void)
 }
 
 static int
-waypt_write_cb(GPS_PWay* way)
+waypt_write_cb(GPS_PWay*)
 {
   static int i;
   int n = waypt_count();
@@ -1103,7 +1103,7 @@ route_waypt_pr(const Waypoint* wpt)
 }
 
 static void
-route_noop(const route_head* wp)
+route_noop(const route_head* )
 {
 }
 
index 613de3149d457f3fe53f9435c3714c0546db6a01..ed041438e10d8d90e009a7fca5d0bcf38021b0c3 100644 (file)
@@ -667,7 +667,7 @@ static garmin_color_t gt_colors[] = {
   { "Cyan",            0xFFFF00 },
   { "White",           0xFFFFFF },
   { "Transparent",     unknown_color }, /* Currently not handled */
-  { NULL }
+  { NULL, 0 }
 };
 
 #define GT_COLORS_CT ((sizeof(gt_colors) / sizeof(gt_colors[0])) - 1)
index 7adc2da28333eb5f24c53e43847daa574d5486fc..de975cc4c51a5ce944029206d71f38c30bbb6a73 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2002 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -58,46 +58,30 @@ xg_tag_mapping google_map[] = {
 
 void goog_script(xg_string args, const QXmlStreamAttributes*)
 {
-#if NEW_STRINGS
-  if (true) {
-#else
-  if (args) {
-#endif
-    if (script) {
-      script = xstrappend(script, CSTRc(args));
-    } else {
-      script = xstrdup(args);
-    }
+  if (script) {
+    script = xstrappend(script, CSTRc(args));
+  } else {
+    script = xstrdup(args);
   }
 }
 
+
 void goog_points(xg_string args, const QXmlStreamAttributes*)
 {
-#if NEW_STRINGS
-  if (true) {
-#else
-  if (args) {
-#endif
-    if (encoded_points) {
-      encoded_points = xstrappend(encoded_points, CSTRc(args));
-    } else {
-      encoded_points = xstrdup(args);
-    }
+  if (encoded_points) {
+    encoded_points = xstrappend(encoded_points, CSTRc(args));
+  } else {
+    encoded_points = xstrdup(args);
   }
 }
 
+
 void goog_levels(xg_string args, const QXmlStreamAttributes*)
 {
-#if NEW_STRINGS
-  if (true) {
-#else
-  if (args) {
-#endif
-    if (encoded_levels) {
-      encoded_levels = xstrappend(encoded_levels, CSTRc(args));
-    } else {
-      encoded_levels = xstrdup(args);
-    }
+  if (encoded_levels) {
+    encoded_levels = xstrappend(encoded_levels, CSTRc(args));
+  } else {
+    encoded_levels = xstrdup(args);
   }
 }
 
index 06f8b260e0dc8f3ae48563aaf0024bc93bf505dd..d95cc321be732abb9d0c9b45bf94380c45feee27 100644 (file)
@@ -63,7 +63,7 @@ goog_instr(xg_string args, const QXmlStreamAttributes*)
 
 static int goog_step = 0;
 
-static long
+long
 decode_goog64(const QByteArray& str, int& pos)
 {
   long result = 0;
index d22bb06f239482917be27dbf1db90855080a330c..19a98a92c1379146bb9bd6fc2fd0c3ac46d7a823 100644 (file)
@@ -270,13 +270,13 @@ const char* kml_tags_to_ignore[] = {
   NULL,
 };
 
-void wpt_s(xg_string args, const QXmlStreamAttributes*)
+void wpt_s(xg_string, const QXmlStreamAttributes*)
 {
   wpt_tmp = new Waypoint;
   wpt_tmp_queued = 0;
 }
 
-void wpt_e(xg_string args, const QXmlStreamAttributes*)
+void wpt_e(xg_string, const QXmlStreamAttributes*)
 {
   if (wpt_tmp_queued) {
     waypt_add(wpt_tmp);
@@ -300,7 +300,7 @@ void wpt_time(xg_string args, const QXmlStreamAttributes*)
 {
   wpt_tmp->SetCreationTime(xml_parse_time(args));
 }
-void wpt_coord(const QString& args, const QXmlStreamAttributes* attrv)
+void wpt_coord(const QString& args, const QXmlStreamAttributes*)
 {
   int n = 0;
   double lat, lon, alt;
@@ -323,7 +323,7 @@ void wpt_icon(xg_string args, const QXmlStreamAttributes*)
   }
 }
 
-void trk_coord(xg_string args, const QXmlStreamAttributes* attrv)
+void trk_coord(xg_string args, const QXmlStreamAttributes*)
 {
   int consumed = 0;
   double lat, lon, alt;
@@ -467,7 +467,7 @@ kml_wr_position_deinit(void)
 
 
 void
-kml_output_linestyle(char* color, int width)
+kml_output_linestyle(char* /*color*/, int width)
 {
   // Style settings for line strings
   writer->writeStartElement("LineStyle");
index 4dae1f5e58ea86cd0d77af0684766dfd771e4c3f..f0eb56d025aa23f14aaae2845a0460eb0162c421 100644 (file)
@@ -1246,7 +1246,7 @@ nmea_wayptpr(const Waypoint* wpt)
 }
 
 void
-nmea_track_init(const route_head* rte)
+nmea_track_init(const route_head*)
 {
   last_time = -1;
 }
index e5f0e0143e6be0093c5699c75b323693dc9cd982..34dc8f6a77a9cd0e24641669e3998b4a477ff56a 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Route / track simplification filter
 
-    Copyright (C) 2002 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index 66632b7afbee89dc774cdbe755f425a73b05615f..c8a64f8d85f2eed1360d5fca8cf5453cd37db781 100644 (file)
@@ -5,7 +5,7 @@
        Copyright (C) 2005 Olaf Klein, o.b.klein@gpsbabel.org
 
        Based on kml.c, Keyhole "kml" format.
-       Copyright (C) 2005 Robert Lipe, robertlipe@usa.net
+       Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
index ee4a5616266033dc84b3ab61bb86270f3b767c7f..ca27ad07d542c89f65de2d471ea95c8b4bed7e87 100644 (file)
@@ -2,7 +2,7 @@
 
     teletype .way module
 
-    Copyright (C) 2009  Robert Lipe, robertlipe@gpsbabel.org
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index ae365423b79c0fc5d52adeec613032d7770bc1b5..a0a8e77587c96b8771eb5e6ac1aee5aae63b3933 100644 (file)
@@ -2,7 +2,7 @@
     Output only format for Human Readable formats.
 
     Copyright (C) 2004 Scott Brynen, scott (at) brynen.com
-    Copyright (C) 2002 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index 1b2a4c6f1d7b23c64c23e4ecc8e03b863960771e..f40e2ba07722dd6bfaea22a8ce906f240a656adb 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Access to  U.S. Census Bureau "tiger" format.
 
-    Copyright (C) 2002 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index 3e88401250807f3d198c96010efde875f3222062..19ef9b499c5b92cb82efec00d536dfcd7708c1d4 100644 (file)
@@ -14,7 +14,7 @@
     Based on the specifications found in the TopoMapPro documentation available from website
     ----------------------------------------------------------------------------------------
 
-    Copyright (C) 2002 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index 8d303ff71760f0aac294d2981265a5a593c15185..f98d873995dcceb31ffa75d0ac80e7eb8b35b318 100644 (file)
@@ -82,13 +82,13 @@ xg_tag_mapping loc_map[] = {
 };
 
 /* work variables for wfff_xxx */
-static char*   ap_mac          =0;
-static char*   ap_ssid         =0;
-static char*   ap_type         =0;
-static char*   ap_wep          =0;
+static QString ap_mac;
+static QString ap_ssid;
+static QString ap_type;
+static QString ap_wep;
 static int             ap_chan         =0;
 static time_t  ap_first        =0;
-static char*   ap_last         =0;
+static QString         ap_last;
 static float   ap_mnrssi       =0.0;
 static float   ap_mxrssi       =0.0;
 static float   ap_hdop         =0.0;
@@ -96,24 +96,18 @@ static double       ap_lat          =0.0;
 static double  ap_lon          =0.0;
 
 /*     Start of AP block */
-void wfff_s(xg_string args, const QXmlStreamAttributes*)
+void wfff_s(xg_string, const QXmlStreamAttributes*)
 {
-  xfreez(ap_mac);
-  xfreez(ap_ssid);
-  xfreez(ap_type);
-  xfreez(ap_wep);
-  xfreez(ap_last);
   ap_mnrssi=0.0;
   ap_mxrssi=0.0;
   ap_chan=0;
   ap_hdop=0.0;
   ap_first=0;
-  ap_last=0;
+  ap_last=QString();
   ap_lat=0.0;
   ap_lon=0.0;
 }
-#if NEW_STRINGS
-// anything here involving 'xstrdup' should be fixed by fixing the underlying data type.
+
 void wfff_mac(const QString& args, const QXmlStreamAttributes*) { ap_mac = xstrdup(args); }
 void wfff_ssid(const QString& args, const QXmlStreamAttributes*) { ap_ssid = xstrdup(args); }
 void wfff_type(const QString& args, const QXmlStreamAttributes*) { ap_type = xstrdup(args); }
@@ -126,92 +120,6 @@ void wfff_wep(const QString& args, const QXmlStreamAttributes*) { ap_wep = xstrd
 void wfff_hdop(const QString& args, const QXmlStreamAttributes*) { ap_hdop = args.toDouble(); }
 void wfff_lat(const QString& args, const QXmlStreamAttributes*) { ap_lat = args.toDouble(); }
 void wfff_lon(const QString& args, const QXmlStreamAttributes*) { ap_lon = args.toDouble(); }
-#else
-
-void wfff_mac(xg_string args, const QXmlStreamAttributes*)
-{
-  if (args) {
-    ap_mac = xstrdup(args);
-  }
-}
-
-void wfff_ssid(xg_string args, const QXmlStreamAttributes*)
-{
-  if (args) {
-    ap_ssid = xstrdup(args);
-  }
-}
-
-void wfff_type(xg_string args, const QXmlStreamAttributes*)
-{
-  if (args) {
-    ap_type = xstrdup(args);
-  }
-}
-
-void wfff_mnrssi(xg_string args, const QXmlStreamAttributes*)
-{
-  if (args) {
-    ap_mnrssi = atof(args);
-  }
-}
-
-void wfff_mxrssi(xg_string args, const QXmlStreamAttributes*)
-{
-  if (args) {
-    ap_mxrssi = atof(args);
-  }
-}
-
-void wfff_chan(xg_string args, const QXmlStreamAttributes*)
-{
-  if (args) {
-    ap_chan = atoi(args);
-  }
-}
-
-void wfff_first(xg_string args, const QXmlStreamAttributes*)
-{
-  if (args) {
-    ap_first = xml_parse_time(args).toTime_t();
-  }
-}
-
-void wfff_last(xg_string args, const QXmlStreamAttributes*)
-{
-  if (args) {
-    ap_last = xstrdup(args);
-  }
-}
-
-void wfff_wep(xg_string args, const QXmlStreamAttributes*)
-{
-  if (args) {
-    ap_wep = xstrdup(args);
-  }
-}
-
-void wfff_hdop(xg_string args, const QXmlStreamAttributes*)
-{
-  if (args) {
-    ap_hdop = atof(args);
-  }
-}
-
-void wfff_lat(xg_string args, const QXmlStreamAttributes*)
-{
-  if (args) {
-    ap_lat = atof(args);
-  }
-}
-
-void wfff_lon(xg_string args, const QXmlStreamAttributes*)
-{
-  if (args) {
-    ap_lon = atof(args);
-  }
-}
-#endif
 
 /*     End of AP Block, set waypoint and add */
 static long tosscount=0;
@@ -232,8 +140,8 @@ void wfff_e(xg_string args, const QXmlStreamAttributes*)
 
     snprintf(desc, sizeof desc,
              "%s/%s/WEP %s/Ch %d/%2.0fdB/%2.0fdB/%s",
-             (snmac?ap_ssid:ap_mac), ap_type, ap_wep,
-             ap_chan, ap_mnrssi, ap_mxrssi, ap_last);
+             snmac?CSTR(ap_ssid):CSTR(ap_mac), CSTR(ap_type), CSTR(ap_wep),
+             ap_chan, ap_mnrssi, ap_mxrssi, CSTR(ap_last));
     wpt_tmp->description = desc;
 
     wpt_tmp->latitude = ap_lat;
@@ -265,17 +173,8 @@ void wfff_e(xg_string args, const QXmlStreamAttributes*)
   } else {
     tosscount++;
   }
-
-  /* cleanup */
-  xfreez(ap_mac);
-  xfreez(ap_ssid);
-  xfreez(ap_type);
-  xfreez(ap_wep);
-  xfreez(ap_last);
-
 }
 
-
 void
 wfff_xml_rd_init(const char* fname)
 {
@@ -293,14 +192,6 @@ wfff_xml_read(void)
 void
 wfff_xml_rd_deinit(void)
 {
-
-  /* cleanup */
-  xfreez(ap_mac);
-  xfreez(ap_ssid);
-  xfreez(ap_type);
-  xfreez(ap_wep);
-  xfreez(ap_last);
-
   xml_deinit();
 
   if (tosscount) {